package com.zl.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

/**
 * @author zl
 * @date 2023/3/23
 * @apiNote
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@RefreshScope    // 添加刷新的作用域
public class HeroConfig {
    @Value("${hero.name}")
    private String name;
    @Value("${hero.age}")
    private Integer age;
    @Value("${hero.address}")
    private String address;
}
